package com.wxy.web.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wxy.web.mapper.ModuleMapper;
import com.wxy.web.model.Module;
import com.wxy.web.service.IModuleService;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author wxy
 * @since 2021-06-20
 */
@Service
public class ModuleServiceImpl extends ServiceImpl<ModuleMapper, Module> implements IModuleService {
    public Module getByUri(String uri){
        LambdaQueryWrapper<Module> lambdaQueryWrapper = Wrappers.lambdaQuery();
        lambdaQueryWrapper.eq(Module::getUrl , uri);
        return this.getBaseMapper().selectOne(lambdaQueryWrapper);
    }
}
